<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./axios.js"></script>
</head>
<body>
    <input type="text" class="user">
    <button class="btn">搜索</button>
    <div id="div"></div>

    <script>
        let user=document.querySelector('.user');
        let btn=document.querySelector('.btn');
        btn.onclick = function() {
            axios.get(`/user/keywore/${user.value}`).then((res) => {
                // xr(res.data)
                console.log(res.data);
                
            })

            // function xr(arr){
            //     div.innerHTML=arr.map(item=>{
            //         return `<p>${item}</p>`
            //     }).join('')
            // }
        }
    </script>
</body>
</html>